import request from '@/utils/request'

// 查询库存分配记录列表
export function listInventoryAllocation(query) {
  return request({
    url: '/wms/inventory/allocation/list',
    method: 'get',
    params: query
  })
}

// 查询库存分配记录详细
export function getInventoryAllocation(allocationId) {
  return request({
    url: '/wms/inventory/allocation/' + allocationId,
    method: 'get'
  })
}

// 新增库存分配记录
export function addInventoryAllocation(data) {
  return request({
    url: '/wms/inventory/allocation',
    method: 'post',
    data: data
  })
}

// 修改库存分配记录
export function updateInventoryAllocation(data) {
  return request({
    url: '/wms/inventory/allocation',
    method: 'put',
    data: data
  })
}

// 删除库存分配记录
export function delInventoryAllocation(allocationId) {
  return request({
    url: '/wms/inventory/allocation/' + allocationId,
    method: 'delete'
  })
}

// 根据出库单ID查询库存分配记录
export function getInventoryAllocationByOrderId(orderId) {
  return request({
    url: '/wms/inventory/allocation/order/' + orderId,
    method: 'get'
  })
}